﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

//1.查看文本文件，cat CatFile.txt

//main137：查看文本文件
int main137()
{
	printf("2.请输入您要查看的文件：\n");
	char fileName[256];
	scanf("%s", fileName);//E:\file\VIEditorCode.txt
	getchar();

	FILE* fp = fopen(fileName, "r");
	if (!fp)
	{
		return -1;
	}

	//3.文件内容的结束标识，==EOF，即==-1；
	char ch;
	while ((ch = fgetc(fp)) != EOF)
	{
		printf("%c", ch);
	}
	fclose(fp);

	/*#include <stdio.h>

	int main(void)
	{
			printf("hello world\n");
			return 0;
	}*/

	system("pause");
	return EXIT_SUCCESS;
}